package com.ZeroCarbon.client;

import com.ZeroCarbon.config.FeignConfig;
import com.ZeroCarbon.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * 用户信息远程调用接口
 *
 * @since 2024-10-13
 */
@FeignClient(name = "user-server", configuration = FeignConfig.class)
public interface UserClient {

    /**
     * 获取用户基本信息
     *
     * @param userId 用户id
     */
    @GetMapping("/user/getBaseInfo")
    Result getBaseInfo(@RequestParam(value = "userId", required = false) String userId);

    /**
     * 更新账户余额和积分
     *
     * @param id       用户id
     * @param money    增加金额
     * @param integral 增加积分
     */
    @GetMapping("/user/addMoneyAndIntegral")
    Result addMoneyAndIntegral(@RequestParam String id, @RequestParam double money, @RequestParam int integral);

    /**
     * 获取用户名称
     *
     * @param id 用户id
     */
    @GetMapping("/user/getUsername")
    Result getUsername(@RequestParam String id);

    /**
     * 获取用户头像
     */
    @GetMapping("/user/getAvatarById")
    Result getAvatarById(@RequestParam String id);
}
